package java67_adv6;

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class ReaderAndWriter {

	public static void main(String[] args) {
		try {
			FileWriter fw = new FileWriter("java67.txt");
			fw.write(21016);
			fw.write(new char[] { '三', '麻', '子' });
			fw.append("\r\n");
			fw.append("李平莉\r\n");
			fw.write("李康");
			fw.write("林国顺");
			fw.close();
			FileReader fr = new FileReader("java67.txt");
			int c1 = fr.read();
			System.out.println(c1);
			char cr[] = new char[40];
			int len = fr.read(cr);
			String str = new String(cr, 0, len);
			System.out.println(str);
			fr.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
